<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>emplist</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" th:href="@{/css/style.css}"/>
</head>
<body>
<div id="wrap">
    <div id="top_content">
        <div id="header">
            <div id="rightheader">
                <p>
                    2009/11/20
                    <br/>
                    <a th:if="${session.user != null}" th:href="@{/employee/logout}">安全退出</a>
                    <a th:if="${session.user == null}" th:href="@{/employee/login}">立即登录</a>
                </p>
            </div>
            <div id="topheader">
                <h1 id="title">
                    <a href="#">main</a>
                </h1>
            </div>
            <div id="navigation">
            </div>
        </div>
        <div id="content">
            <p id="whereami">
            </p>
            <h1>
                欢迎
                <span th:if="session.user != null" th:text="${session.user.realname}"></span>
                <span th:if="session.user == null">游客</span>
            </h1>
            <table class="table">
                <tr class="table_header">
                    <td>
                        编号
                    </td>
                    <td>
                        姓名
                    </td>
                    <td>
                        头像
                    </td>
                    <td>
                        工资
                    </td>
                    <td>
                        生日
                    </td>
                    <td>
                        操作
                    </td>
                </tr>
                <tr th:class="${state.odd?'row1':'row2'}" th:each="employee,state:${employeeList}">
                    <td th:text="${employee.id}">

                    </td>
                    <td th:text="${employee.name}">

                    </td>
                    <td>
                        <img th:src="@{/} + ${employee.photo}" width="60">
                    </td>
                    <td th:text='${employee.salary}'>

                    </td>
                    <td th:text="${#dates.format(employee.birthday,'yyyy-MM-dd')}">

                    </td>
                    <td>
                        <a th:href="@{/employee/delete(id=${employee.id})}">删除</a>&nbsp;<a
                            th:href="@{/employee/update(id=${employee.id})}">更新</a>
                    </td>
                </tr>
            </table>
            <p>
                <input type="button" class="button" value="添加" onclick="addEmp()"/>
                <script>
                    function addEmp() {
                        location.href = '[[@{/addEmp}]]';
                    }
                </script>
            </p>
        </div>
    </div>
    <div id="footer">
        <div id="footer_bg">
            ABC@126.com
        </div>
    </div>
</div>
</body>
</html>
